package mn.idax.exchange.otc.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Create by jack_huang on 2018/8/9
 */
@Getter
@AllArgsConstructor
public enum OrderEnum {

    // 交易类型 1-购买 2-出售
    TYPE_BUY(1,"购买"),
    TYPE_SELL(2,"出售"),

    //收款类型
//    MONEYTYPE_CNY(1,"CNY"),

    //下单来源
//    ORDERSOURCE_PC(1,"PC"),

    //推送消息
//    MESSAGE_UNPAID(1,"给您发来了新的交易请求"),
//    MESSAGE_UNPAID_FROZEN(2,"订单数字货币已由系统锁定托管，买家在订单有效期内付款并标记付款完成"),
//    MESSAGE_PAID(3,"已经确认付款"),//买家
//    MESSAGE_TORELEASED(4,"已经付款，正在等待【卖家昵称】确认"),

    ;

    private Integer code;
    private String type;

    public static Integer getCode(Integer code) {
        for (OrderEnum orderEnum : OrderEnum.values()) {
            if(orderEnum.getCode().equals(code)){
                return orderEnum.getCode();
            }
        }
        return null;
    }

    public static String getType(Integer code) {
        for (OrderEnum orderEnum : OrderEnum.values()) {
            if(orderEnum.getCode().equals(code)){
                return orderEnum.getType();
            }
        }
        return null;
    }
}
